from rest_framework.generics import ListAPIView
from rest_framework.permissions import IsAdminUser

from apps.goods.models import GoodsCategory
from apps.meiduo_admin.serializers import GoodsCategorySerializer


class SKUCategoriesViews(ListAPIView):
    permission_classes = [IsAdminUser]
    queryset = GoodsCategory.objects.filter(subs=None).order_by('id')
    serializer_class = GoodsCategorySerializer
